package ws.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;

import java.util.Date;

/**
 * Created by alex on 15-1-23.
 */
@Controller
public class GreetingController {

    public static final Logger LOG = LoggerFactory.getLogger(GreetingController.class);
    
    @MessageMapping("/greeting")
    public String handle(String greeting){
       
        LOG.debug("Web Socket Message {} " + greeting);
        
        return "["+new Date().getTime()+"]" + greeting;
    }
}
